1. Field of the Invention
The present invention relates to a coding technique, and more particularly to a technique for performing coding by selecting an optimum one out of many types of predictive coding processes.
2. Description of the Background Art
An encoder compressively encodes uncompressed image data such as YCbCr or the like to output stream data. In order to compresses the image data, the encoder selects an optimum one out of various types of predictive coding processes. For intra-frame prediction, the encoder selects an optimum one out of a plurality of prediction modes. For inter-frame prediction, the encoder selects an optimum motion compensation block. Alternatively, the encoder selects which of the intra-frame prediction and the inter-frame prediction should be used.
In order to select a prediction mode in the intra-frame prediction or select a motion compensation block in the inter-frame prediction, conventionally, an evaluation value, i.e., SATD (sum of absolute transformed difference) has been used. The encoder uses a value of the SATD as a cost of coding.
Specifically, the encoder calculates a differential block from the difference between a coding object block and a prediction block. The encoder carries out frequency conversion of the differential block by performing Hadamard Transform on the differential block in vertical and horizontal directions. The encoder obtains the SATD by computing a sum of absolute values of frequency components in the frequency-converted differential block.
The encoder calculates the SATDs for all the prediction modes or all the motion compensation blocks to obtain coding costs for all the predictive coding processes. By selecting one of the predictive coding processes, of which the coding cost is minimum, the encoder can select a process in which less amount of codes are generated and thereby improve the coding efficiency.
In the H.264/AVC standard, in order to quantize a signal of orthogonally transformed frequency component, a quantization matrix is used. In other words, respective signals of frequency components are quantized with different quantization step values. For this reason, the proportional relation between the coding cost calculated by using the SATD and the amount of generated codes is broken. There arises a problem that an optimum predictive coding process by which the amount of generated codes becomes minimum cannot be selected by using the SATD. Not optimum allocation of the amount of generated codes in a stream may sometimes cause degradation of image quality.
Japanese Patent Application Laid Open Gazette No. 2000-078589 discloses a technique for reducing the amount of computation required for the calculation of the coding cost. In Japanese Patent Application Laid Open Gazette No. 2000-078589, a coding object block and a reference block are orthogonally transformed individually. Respective sums of absolute differences (SADs) are obtained by using only signals in a low frequency domain out of frequency components in these orthogonally transformed blocks. The calculated sums of absolute differences (SADs) are compared with each other, and a predictive coding process with less amount of generated codes is thereby selected.
Japanese Patent Application Laid Open Gazette No. 2004-241957 also discloses a technique for reducing the amount of computation required for the calculation of the coding cost. In Japanese Patent Application Laid Open Gazette No. 2004-241957, the coding cost is calculated by performing orthogonal transform so that only specific frequency components can be left.
Both Japanese Patent Application Laid Open Gazette Nos. 2000-078589 and 2004-241957 disclose a method of calculating the coding cost for limited specific frequency components. Though the amount of computation can be reduced by using the techniques disclosed in the above documents, there arises a problem of causing a reduction in the accuracy of computation of the coding cost.